package com.study.service.impl;

import com.github.pagehelper.PageHelper;
import com.study.dao.AppInfoDao;
import com.study.entity.AppInfo;
import com.study.service.IAppInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/10/18/018.
 */
@Service
public class AppInfoServiceImpl implements IAppInfoService {
    @Autowired
    private AppInfoDao appInfoDao;

    @Override
    public AppInfo findOneById(Integer id) {
        return appInfoDao.findOneById(id);
    }

    @Override
    public List<AppInfo> findList(AppInfo appInfo) {
        return null;
    }

    @Override
    public List<AppInfo> findList(AppInfo appInfo,Integer page,Integer size) {
        PageHelper.startPage(page,size);//使用分页插件，自动在sql后面添加limit语句
        return appInfoDao.findList(appInfo);
    }

    @Override
    public int updateOne(AppInfo appInfo) {
        return appInfoDao.updateOne(appInfo);
    }

    @Override
    public int saveOne(AppInfo appInfo) {
        return appInfoDao.saveOne(appInfo);
    }

    @Override
    public int deleteById(Integer id) {
        return 0;
    }

}
